
//
//  MyHeadView.m
//  BaJieLvYouForIphone
//
//  Created by zhangwo on 16/8/12.
//  Copyright © 2016年 GuoBuGa. All rights reserved.
//

#import "MyHeadView.h"

@implementation MyHeadView

@synthesize imageView = _imageView;
@synthesize textLabel = _textLabel;

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"icon-headView-task.png"]];
        self.imageView = [[UIImageView alloc] init];
        self.textLabel = [[UILabel alloc] init];
        self.textLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
    }
    return self;
}

- (void)setImageView:(UIImageView *)imageView{
    if (imageView) {
        _imageView = imageView;
        _imageView.frame = CGRectMake(15, 45, 60, 60);
        _imageView.layer.cornerRadius = 30;
        _imageView.layer.masksToBounds = YES;
        [self addSubview:_imageView];
    }
}

- (void)setTextLabel:(UILabel *)textLabel{
    if (textLabel) {
        _textLabel = textLabel;
        _textLabel.frame = CGRectMake(_imageView.frame.size.width+20, 60, self.frame.size.width/2, 30);
        _textLabel.font = [UIFont systemFontOfSize:16.0];
        _textLabel.text = @"点此登录";
        [self addSubview:_textLabel];
    }
}

@end
